package se19team1e.util;

/**
 * 
 * A helper utility class for comparison.
 * 
 * @author lai shiaw san
 *
 */
public class ComparisonUtils {

    /**
     * Checks if two values are equal
     * <p>
     * Null is considered equal.
     * </p>
     * @param obj1 Object 1 to check.
     * @param obj2 Object 2 to check.
     * @return True if the both are equal or both are null.
     */
    public static boolean equals( Object obj1, Object obj2 ) {
        if ( obj1 == null && obj2 == null ) {
            return true;
        }
        if ( obj1 == null ) {
            return false;
        }
        if ( obj2 == null ) {
            return false;
        }
        return obj1.equals( obj2 );
    }
    
}
